﻿using UnityEngine;

public class SpikePlatformCtl_Spike : MonoBehaviour
{

    private SpikePlatformCtl ctl;


    void Start()
    {
        ctl =  GetComponentInParent<SpikePlatformCtl>();
    }

    private void OnCollisionEnter2D(Collision2D collision)
    {
        if (collision.gameObject.CompareTag(GameManager.Instance.PlayerTag))
        {
            ctl.OnTouchSpike(transform.position.x);
        }
    }
}
